// 购物车列表
$("#head_car").hover(function(){
    $(this).css("background","#fff");
    $(".head_car_text").css("color","#ff6700");
    $("#car_content").css({"width":"300px"}).animate({
        height:"99px"
    },300);
    $("#car_content").children().css("display","block");
    $("#car_content").css("box-shadow","0px 5px 5px rgba(0,0,0,0.15)");
},function(){
    $(this).css("background","#424242");
    $(".head_car_text").css("color","#b0b0b0");
    $("#car_content").css({"width":"300px"}).animate({
        height:"0px"
    },300);
    $("#car_content").children().css("display","none");
})

// 搜索框边框变色
$("#find_input").focus(function(){
    $("#find_wrap").css("border","1px solid #ff6700");
    $("#find_btn").css("border-left","1px solid #ff6700");
})
$("#find_input").blur(function(){
    $("#find_wrap").css("border","1px solid #F0F0F0");
    $("#find_btn").css("border-left","1px solid #F0F0F0");
})

//GO按钮鼠标移动上去变色
$("#find_btn").hover(function(){
    $(this).css({"background":"#ff6700",color:"#fff"});
},function(){
    $(this).css({"background":"#fff",color:"#424242"});
})

//导航栏鼠标移动上去显示详情列表
$(".menu_li").hover(function(){
    $("#menu_content_bg").css("border-top","1px solid #D0D0D0");
    $("#menu_content_bg").css("border-bottom","1px solid #D0D0D0");
    $(this).css("color","#ff6700");
    $("#"+$(this).attr("control")).show();
    $("#menu_content_bg").height(230);
},function(){
    $("#"+$(this).attr("control")).hide();
    $(this).css("color"," #424242");
    $("#menu_content_bg").height(0);
    $("#menu_content_bg").css("border-top","0px solid #D0D0D0");
    $("#menu_content_bg").css("border-bottom","0px solid #D0D0D0");
})

//轮播图自动播放和点击左右箭头切图
$(function(){
    var i=0;
    var big_banner_pic = $("#big_banner_pic");
    var allimg=$("#big_banner_pic li").length;
    //自动播放事件
    function img_change(){
        var img_i=i*-1226+"px";
        big_banner_pic.animate({opacity:".2"},100,function(){
            big_banner_pic.css("left",img_i );
            big_banner_pic.animate({
                opacity: "1"
            }, 100);
        })
    }
    function automatic(){
        i+=1;
        if(i>=allimg){
            i=0;
        }
        img_change();
    }
    change_self_time = setInterval(automatic, 3000);
    //左右箭头事件
    $("#big_banner_change_wrap").hover(function(){
        clearInterval(change_self_time);
        $("#big_banner_change_wrap").children().show();
    },function(){
        change_self_time = setInterval(automatic, 3000);
        $("#big_banner_change_wrap").children().hide();
    })
    $("#big_banner_change_prev").click(function(){
        i += 1;
        if (i >= allimg) {
            i = 0;
        }
        img_change();
    })
    $("#big_banner_change_prev").hover(function(){
        $("#big_banner_change_prev").css("background","rgba(0,0,0,0.8)");
        $("#big_banner_change_prev").css("color","orangered");
    },function(){
        $("#big_banner_change_prev").css("background","none");
        $("#big_banner_change_prev").css("color","#fff");
    })
    $("#big_banner_change_next").click(function(){
        i -= 1;
        if (i <= 0) {
            i = allimg - 1;
        }
        img_change();
    })
    $("#big_banner_change_next").hover(function(){
        $("#big_banner_change_next").css("background","rgba(0,0,0,0.8)");
        $("#big_banner_change_next").css("color","orangered");
    },function(){
        $("#big_banner_change_next").css("background","none");
        $("#big_banner_change_next").css("color","#fff");
    })
})

//Tap效果
$("#banner_menu_wrap").children().hover(function(){
    $(this).css("background","#ff6700");
    $(this).children(".banner_menu_content").css("border","1px solid #F0F0F0").show();
},function(){
    $(this).css("background","none");
    $(this).children(".banner_menu_content").css("border","0px solid #F0F0F0").hide();
})

//商品栏变色效果
$("#head_other li").hover(function(){
    $(this).css("color","#fff");
},function(){
    $(this).css("color","#888");
})

// 大米明星单品商品栏左右切换
$(".head_hot_goods_prave").hover(function(){
    $(this).css("color","#ff6700");
},function(){
    $(this).css("color","#BEBEBE");
});
$(".head_hot_goods_next").hover(function(){
    $(this).css("color","#ff6700");
},function(){
    $(this).css("color","#BEBEBE");
});
$(".head_hot_goods_prave").click(function(){
    $("#head_hot_goods_content").children("ul").animate({
        left:"-1226px"
    },100)
})
$(".head_hot_goods_next").click(function(){
    $("#head_hot_goods_content").children("ul").animate({
        left:"0"
    },100)
})

//智能硬件商品栏事件
$(".floor_goods_wrap_li").hover(function(){
    $(this).css({"top":"-3px","box-shadow":"0px 15px 30px rgba(0,0,0,0.2)"});
},function(){
    $(this).css({"top":"0px","box-shadow":"none"});
})
